#ifndef SEMANTIC_H
#define SEMANTIC_H
#include<bits/stdc++.h>
#include"symtable.h"
#include"driver.h"

struct semanticError{

  private:
    std::vector<std::string> errors;
  public:
    std::vector<node*> loops; 
    semanticError();
    void add(std::string error);
    void display();
};

struct semanticDriver:driver{
  node* block;
  semanticDriver();
  semanticDriver(driver* myDriver);
  static semanticDriver* getSemanticDriver(driver* myDriver);
};

extern semanticError* error2;

int BREAK_check     (driver* originDriver);
int CONTINUE_check  (driver* originDriver);
int ID_check        (driver* originDriver);
int DEF_check       (driver* originDriver);
int DECL_check      (driver* originDriver);
int RETURN_check    (driver* originDriver);
int OP1_check       (driver* originDriver);
int OP2_check       (driver* originDriver);
int FUNC_check      (driver* originDriver);
int INITVAL_check   (driver* originDriver);
int BRAKET_check    (driver* originDriver);
int LOOP_push       (driver* originDriver);
int LOOP_pop        (driver* originDriver);
#endif
